Skip to content

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jul 17, 2025

This PR performs some maintenance of the Data Connect demo application. It introduces a mechanism to pass 'preview flags' to the Data Connect cli, updates the dependencies to the latest versions, and improves some null-handling logic to be more Kotlin-idiomatic.

Highlights

  • Data Connect Preview Flags Support: Introduced a new Gradle property, dataConnect.demo.dataConnectPreviewFlags, allowing the specification of preview flags for the Data Connect emulator and code generation. These flags are passed as a DATA_CONNECT_PREVIEW environment variable to the Firebase CLI.
  • Dependency Updates: Updated numerous dependencies for the Data Connect demo, including Android Gradle Plugin, Google Services, Firebase BOM, Kotlin Coroutines, Kotlin Serialization, and AndroidX Lifecycle, to their latest versions.
  • Android SDK Version Bump: Upgraded the Android compileSdk and targetSdk versions from API level 35 to 36.
  • Kotlin Idiomatic Refactoring: Refactored several null checks in the Gradle build script to use idiomatic Kotlin ?.let for improved readability and safety.
Changelog
  • firebase-dataconnect/demo/build.gradle.kts
    • Updated various build and runtime dependencies, including com.android.application (8.11.0 -> 8.11.1), com.google.gms.google-services (4.4.2 -> 4.4.3), com.diffplug.spotless (7.0.0.BETA4 -> 7.1.0), firebase-bom (33.15.0 -> 33.16.0), kotlinx-coroutines-core (1.10.1 -> 1.10.2), kotlinx-coroutines-android (1.10.1 -> 1.10.2), kotlinx-serialization-core (1.8.1 -> 1.9.0), and androidx.lifecycle:lifecycle-viewmodel-ktx (2.9.1 -> 2.9.2).
    • Bumped compileSdk and targetSdk versions from 35 to 36.
    • Added a new dataConnectPreviewFlags property to the DataConnectGenerateSourcesTask (line 141).
    • Modified the DataConnectGenerateSourcesTask to read the dataConnectPreviewFlags (line 160) and pass them as a DATA_CONNECT_PREVIEW environment variable to the Firebase CLI during SDK generation (line 237).
    • Refactored if (logStream !== null) to logStream?.let { ... } (lines 195-197 to 200-202) and similar null checks for nodeExecutableDirectory and dataConnectEmulatorExecutable (lines 222-242 to 228-235) to use the more concise and idiomatic Kotlin ?.let syntax.
  • firebase-dataconnect/demo/gradle.properties
    • Added a commented-out example entry for dataConnect.demo.dataConnectPreviewFlags with a descriptive comment, explaining its purpose for enabling preview features.

This comment was marked as off-topic.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @dconeybe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Data Connect demo's Gradle build system by adding support for 'preview flags'. This allows developers to enable experimental or unreleased features of Data Connect during the source generation process by configuring a simple Gradle property, providing greater flexibility for testing and development.

Highlights

  • Gradle Task Enhancement: I've extended the DataConnectGenerateSourcesTask in build.gradle.kts to accept an optional dataConnectPreviewFlags property. This allows for passing specific flags to the Data Connect source generation process.
  • Environment Variable Integration: The provided dataConnectPreviewFlags are now passed as a DATA_CONNECT_PREVIEW environment variable to the underlying command executed by the Gradle task, enabling the Data Connect emulator or codegen to utilize these flags.
  • Configuration Property: I've introduced a new Gradle property, dataConnect.demo.dataConnectPreviewFlags, which can be set in gradle.properties or via the command line, to easily configure these preview flags for the demo build.
  • Documentation and Example: I've added commented-out lines in gradle.properties to document the new dataConnect.demo.dataConnectPreviewFlags property, including an example of how to use it with comma-separated values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for dataConnectPreviewFlags to the demo project's Gradle build script. The flags are read from gradle.properties and passed as an environment variable to the Data Connect emulator. The implementation is clear and correct. I've provided one suggestion to use more idiomatic Kotlin for a null check, which will improve code readability and maintainability.

@google-oss-bot

This comment was marked as off-topic.

@google-oss-bot

This comment was marked as off-topic.

@dconeybe dconeybe changed the title dataconnect: demo: add support for data connect preview flags dataconnect: demo: add support for data connect preview flags and update dependencies Jul 17, 2025
@dconeybe

This comment was marked as outdated.

@dconeybe dconeybe requested a review from Copilot July 17, 2025 19:54
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates various dependencies and introduces support for Data Connect preview flags. The implementation is solid, and I appreciate the refactoring to more idiomatic Kotlin code. I have one minor suggestion regarding a null check to align with Kotlin's coding conventions.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for passing Data Connect preview flags through the demo build and updates various dependency and SDK versions.

  • Introduce dataConnectPreviewFlags in gradle.properties and wire it through the DataConnectGenerateSourcesTask.
  • Bump Gradle plugin, Firebase BOM, Kotlin Coroutines, AndroidX, and compile/target SDK to the latest versions.
  • Refactor environment setup and output stream configuration using Kotlin’s null-safe let patterns.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
firebase-dataconnect/demo/gradle.properties Add commented property for configuring preview flags in the demo.
firebase-dataconnect/demo/build.gradle.kts Update plugin/library versions, add preview flags support, refactor setup, and bump SDK targets.
Comments suppressed due to low confidence (3)

firebase-dataconnect/demo/build.gradle.kts:141

  • [nitpick] Add KDoc or a comment explaining the purpose of this property and how it maps to the emulator's preview flags to aid future maintainers.
  @get:Input @get:Optional abstract val dataConnectPreviewFlags: Property<String>

firebase-dataconnect/demo/build.gradle.kts:141

  • Consider adding a test to verify that the preview flags property is correctly read from Gradle properties and passed to the emulator environment.
  @get:Input @get:Optional abstract val dataConnectPreviewFlags: Property<String>

firebase-dataconnect/demo/build.gradle.kts:299

  • [nitpick] Indentation for this property assignment appears misaligned compared to its surrounding configuration. Align it with adjacent property blocks for readability.
      dataConnectPreviewFlags =

@dconeybe
Copy link
Contributor Author

/gemini summary

Copy link
Contributor

Summary of Changes

This pull request primarily focuses on maintaining the Data Connect demo's build environment by updating its dependencies to the latest versions and advancing its Android SDK target. A significant enhancement is the introduction of a mechanism to pass 'preview flags' to the Data Connect emulator and code generation process, enabling the testing and use of experimental features. The changes also include minor code style improvements by adopting more idiomatic Kotlin for null handling.

Highlights

  • Dependency Updates: Updated numerous dependencies for the Data Connect demo, including Android Gradle Plugin, Google Services, Firebase BOM, Kotlin Coroutines, Kotlin Serialization, and AndroidX Lifecycle, to their latest versions.
  • Android SDK Version Bump: Upgraded the Android compileSdk and targetSdk versions from API level 35 to 36.
  • Data Connect Preview Flags Support: Introduced a new Gradle property, dataConnect.demo.dataConnectPreviewFlags, allowing the specification of preview flags for the Data Connect emulator and code generation. These flags are passed as a DATA_CONNECT_PREVIEW environment variable to the Firebase CLI.
  • Kotlin Idiomatic Refactoring: Refactored several null checks in the Gradle build script to use idiomatic Kotlin ?.let for improved readability and safety.
Changelog
  • firebase-dataconnect/demo/build.gradle.kts
    • Updated various build and runtime dependencies, including com.android.application (8.11.0 -> 8.11.1), com.google.gms.google-services (4.4.2 -> 4.4.3), com.diffplug.spotless (7.0.0.BETA4 -> 7.1.0), firebase-bom (33.15.0 -> 33.16.0), kotlinx-coroutines-core (1.10.1 -> 1.10.2), kotlinx-coroutines-android (1.10.1 -> 1.10.2), kotlinx-serialization-core (1.8.1 -> 1.9.0), and androidx.lifecycle:lifecycle-viewmodel-ktx (2.9.1 -> 2.9.2).
    • Bumped compileSdk and targetSdk versions from 35 to 36.
    • Added a new dataConnectPreviewFlags property to the DataConnectGenerateSourcesTask (line 141).
    • Modified the DataConnectGenerateSourcesTask to read the dataConnectPreviewFlags (line 160) and pass them as a DATA_CONNECT_PREVIEW environment variable to the Firebase CLI during SDK generation (line 237).
    • Refactored if (logStream !== null) to logStream?.let { ... } (lines 195-197 to 200-202) and similar null checks for nodeExecutableDirectory and dataConnectEmulatorExecutable (lines 222-242 to 228-235) to use the more concise and idiomatic Kotlin ?.let syntax.
  • firebase-dataconnect/demo/gradle.properties
    • Added a commented-out example entry for dataConnect.demo.dataConnectPreviewFlags with a descriptive comment, explaining its purpose for enabling preview features.
Activity
  • Automated bots posted Javadoc, Coverage, and Size reports, indicating no significant changes in these metrics.
  • The author, dconeybe, requested a bot review and summary.
  • gemini-code-assist[bot] provided a review suggesting the use of ?.let for null checks, which was subsequently implemented by the author. The bot also suggested using == instead of === for null checks, which the author marked as 'Done.' but is not reflected in the provided patch.
  • Copilot suggested renaming an environment variable for consistency and a more idiomatic way to access Gradle providers, neither of which appear to be applied in the provided patch.

@dconeybe dconeybe marked this pull request as ready for review July 17, 2025 20:16
@dconeybe dconeybe requested a review from aashishpatil-g July 17, 2025 20:16
@dconeybe dconeybe merged commit a7d26f5 into main Jul 17, 2025
44 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/demo/PreviewFlagSupport branch July 17, 2025 20:21
@firebase firebase locked and limited conversation to collaborators Aug 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants